//
//  CABaseApi.m
//  Conva
//
//  Created by 黄志景 on 2018/1/25.
//  Copyright © 2018年 com.conva. All rights reserved.
//

#import "CABaseApi.h"
#import "GVUserDefaults+User.h"

@implementation CABaseApi

- (NSString *) error {
    return self.responseJSONObject[@"error"];
}

- (BOOL) done {
    return [self.responseJSONObject[@"done"] boolValue];
}

- (NSString *) errorMsg {
    return self.responseJSONObject[@"error"][@"message"];
}

- (NSString *) token {
    return [GVUserDefaults standardUserDefaults].token;
}

- (YTKRequestMethod) requestMethod {
    return YTKRequestMethodPOST;
}

-(NSString *) getUrl:(NSString *)url {
    return [NSString stringWithFormat:@"%@?token=%@", url, [self token]];
}

@end
